/*
 *  Copyright (c) 2014 Lincong All rights reserved.
 *  This software is the confidential and proprietary information of Lincong.
 *  You shall not disclose such Confidential
 *  Information and shall use it only in accordance with the terms of the license
 *  agreement you entered into with Lincong.
 *   Mail: Lincong <lincong1987@gmail.com>
 *     QQ: 159257119
 *  Phone: 15925711961
 *  This File Created On 2014-1-18 1:16:36.
 *  Document   : firebird.ajax-1.0.1.js
 *  Encoding   : UTF-8
 *  $Id$
 */

define(function (require, exports, module) {

	var Firebird = require("Firebird");

	/**
	 * Firebird.Model
	 * World Start From Here!
	 * @namespace Firebird.Model
	 * @class Firebird.Model
	 */
	Firebird.define("Firebird.Model", {
		config: {},
		statics: {
			_uuid: 1,
			uuid: function () {
				return this._uuid++;
			},
			genId: 1,
			getGenId: function (prefix) {
				var genId = (prefix || "fb-gen-") + this.genId++;
				return genId;
			}
		},
		constructor: function (config) {
			// firebird.info("[Firebird.Model] called");
			this.initConfig(config);
			this._init(config);
		},
		_init: function (config) {
			//firebird.info("[" + this.$className + "#_init] called", config);
		},
		destroy: function () {
			try {
				this.wrapper && this.wrapper.remove();
			} catch (e) {
			}
			try {
				delete this;
			} catch (e) {
			}
		}
	});

	//firebird.info("Firebird.Model loaded.");

	module.exports = Firebird.Model;
});